package com.catal.framework.sequence;

import java.io.Serializable;

/**
 * 序列号明细<p>
 * 
 * <ul>
 * <li>noid 序列号的唯一标识</li>
 * <li>year 年,复位使用,不复位为0</li>
 * <li>month 月,复位使用,不复位为0</li>
 * <li>day 日,复位使用,不复位为0</li>
 * <li>nextId 下一个序列号</li>
 * <li>leftNum 剩余号码</li>
 * </ul>
 * 
 */
public class Instance implements Serializable,Cloneable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 8189123521956839939L;
	private String noid;
	private int year;
	private int month;
	private int day;
	private long nextId;
	private int leftNum;
	
	public String getNoid() {
		return noid;
	}
	public void setNoid(String noid) {
		this.noid = noid;
	}
	public int getDay() {
		return day;
	}
	public void setDay(int day) {
		this.day = day;
	}
	public int getLeftNum() {
		return leftNum;
	}
	public void setLeftNum(int leftNum) {
		this.leftNum = leftNum;
	}
	public int getMonth() {
		return month;
	}
	public void setMonth(int month) {
		this.month = month;
	}
	public long getNextId() {
		return nextId;
	}
	public void setNextId(long nextId) {
		this.nextId = nextId;
	}
	public int getYear() {
		return year;
	}
	public void setYear(int year) {
		this.year = year;
	}
	public Object clone() {
		Object o = null;
		try {
			o = super.clone();
		} catch (CloneNotSupportedException ex) {
			System.out.println(o);
		}
		return o;
	}
	
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("Instance [noid=");
		builder.append(noid);
		builder.append(", year=");
		builder.append(year);
		builder.append(", month=");
		builder.append(month);
		builder.append(", day=");
		builder.append(day);
		builder.append(", nextId=");
		builder.append(nextId);
		builder.append(", leftNum=");
		builder.append(leftNum);
		builder.append("]");
		return builder.toString();
	}
}

